package com.lzf.yh.controller;

import com.lzf.yh.commons.JsonBean;
import com.lzf.yh.entity.ShoppingCart;
import com.lzf.yh.userService.ShoppingCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: Wyz
 * @Date: 2021/5/18 22:08
 * @Description:
 */
@RestController
public class ShoppingCartController {

    @Autowired
    private ShoppingCartService shoppingCartService;

    @GetMapping("selectAllShoppingCart")
    public JsonBean selectAllShoppingCart(Integer userid) {
        return shoppingCartService.selectAllShoppingCart(userid);
    }

    @PostMapping("insertShoppingCart")
    public JsonBean insert(ShoppingCart record) {
        return shoppingCartService.insert(record);
    }

    @GetMapping("deleteShoppingCartById")
    public JsonBean deleteShoppingCartById(Integer id) {
        return shoppingCartService.deleteShoppingCartById(id);
    }

}
